package com.pj.wisdomlogistics.utils;

import java.text.DecimalFormat;

/**
 * Created by zhang on 2017/5/15.
 */

public class DecimalUtils {
    public static String subDouble(double num,int places){
        places = places>6?6:places;
        String formatStr = "0.";
        for (int i = 0; i < places; i++) {
            formatStr+=0;
        }
        DecimalFormat decimalFormat=new DecimalFormat(formatStr);
        return decimalFormat.format(num);
    }
}
